package com.why.jvm.hotspot.src.share.vm.oops.constants;

import lombok.Data;

/**
 * @author xiaoTian
 * @date 2022/7/22 14:49
 * @Description:
 */
@Data
public class ConstantInvokeDynamicInfo extends ConstantInfoBase{

    private int bootstrapMethodAttrIndex;

    private int nameAndTypeIndex;

    private String getBootstrapMethodAttr(){
        return getConstantPool().getConstantPoolMap().get(bootstrapMethodAttrIndex).toString();
    }

    private String getNameAndType(){
        return getConstantPool().getConstantPoolMap().get(nameAndTypeIndex).toString();
    }

    @Override
    public String toString() {
        return "ConstantInvokeDynamicInfo{" +
                "bootstrapMethodAttrIndex=" + bootstrapMethodAttrIndex +
                ", nameAndTypeIndex=" + nameAndTypeIndex +
                ",bootstrapMethodAttr=" + getBootstrapMethodAttr() +
                ", nameAndType=" + getNameAndType() +
                '}';
    }
}
